#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from collections import Iterable,Iterator

print(isinstance([],Iterable))
print(isinstance((),Iterable))
print(isinstance({},Iterable))
print(isinstance('ABC',Iterable))

# 生成器不但可以用于for循环，还要能被next()方法不断调用
# 生成器是Iterator对象，但是list,str,{}并不是Iterator
print(isinstance([],Iterator))
print(isinstance((),Iterator))
print(isinstance({},Iterator))
print(isinstance('ABC',Iterator))